<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta name="robots" content="noindex,nofollow">
<link type="text/css" href="img/alerts.css" rel="stylesheet" media="screen">
<link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
<link rel="stylesheet" type="text/css" href="css/x.css"/>
<link rel="stylesheet" href="css/font.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>资源管理</title>
<script src="js/jquery.min.js"></script>
<script src="js/common.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<script src="layui/layui.js" type="text/javascript"></script>

<script>
	layui.use('layer', function(){
	var layer = layui.layer;
	
	});        

//全屏弹出层
var showv=function (id) {
        var index = layer.open({
            type: 2,          //默认弹出层类型
			shade: 0,
			isOutAnim: false,
            title:"专题视频",  //弹出层角标名称
            content: "admin_topic_vod.php?tid="+id,  //弹出层页面地址
            area: ['95%', '600px'],    //弹出层大小
            maxmin: true   //弹出层是否全屏
        });
        
    }
window.onload=parent.layer.closeAll(); //疯狂模式，关闭所有层
</script>
</head>
<body>
<!--当前导航-->

<div class="layui-fluid">
    <div class="r_content pd15">
      <div style="overflow-x: auto">
        <form id="topicform" action="" method="post" name="topicform">
            <table class="layui-table" style="min-width:900px;">
            <TR style="background-color: #F6F6F6;" align="center">
            <TD width="5%">ID</TD>
            <TD width="40%">专题名称</TD>
            <TD width="15%">专题视频</TD>
            <?php if($cfg_runmode=='0'){?>
            <td width="15%">生成</td>
            <?php }?>
            <TD width="5%">排序</TD>
            <TD width="20%">操作</TD>
            </TR>

<?php
$numPerPage=20;
$page = isset($page) ? intval($page) : 1;
if($page==0) $page=1;

	$csqlStr="select count(*) as dd from sea_topic";
    $row = $dsql->GetOne($csqlStr);
    if(is_array($row)){
        $TotalResult = $row['dd'];
    }else{
        $TotalResult = 0;
    }
    $TotalPage = ceil($TotalResult/$numPerPage);
    if ($page>$TotalPage) $page=$TotalPage;
    $limitstart = ($page-1) * $numPerPage;
    if($limitstart<0) $limitstart=0;
	
$sql="select * from sea_topic ORDER BY  id DESC limit $limitstart,$numPerPage";
	$dsql->SetQuery($sql);
	$dsql->Execute('al');
	while($row=$dsql->GetObject('al'))
	{
				
				if(!is_array($row))
				{
                    $ts=$row->vod;
					$tsn=$row->news;
					
					if($ts !=="")
					{
        			$ta=explode("ttttt",$ts);
        			$tcount=count($ta);
					}else
					{
					$tcount=0;
					}
					
					if($tsn !=="")
					{
        			$tan=explode("ttttt",$tsn);
        			$tcountn=count($tan);
					}else
					{
					$tcountn=0;
					}
				}
				else
				{
					$tcount=0;
					$tcountn=0;
				}
	if ($GLOBALS ['cfg_runmode'] == '0') {
	$topicLink = "/" . $GLOBALS ['cfg_cmspath'] . $GLOBALS ['cfg_filesuffix'] . "/" . $row->enname . $GLOBALS ['cfg_filesuffix2'];
	}
	if ($GLOBALS ['cfg_runmode'] == '1') 
	{
		$topicLink = "/" . $GLOBALS ['cfg_cmspath'] . $GLOBALS ['cfg_filesuffix'] . "/?" . $row->id . $GLOBALS ['cfg_filesuffix2'];
	}
	if ($GLOBALS ['cfg_runmode'] == '2') {
		$topicLink = "/" . $GLOBALS ['cfg_cmspath'] . $GLOBALS ['cfg_filesuffix'] . "/" . $row->id . $GLOBALS ['cfg_filesuffix2'];
	}
?>  
     <TR  align="center" <?php if($id==$row->id){?> class="editlast"<?php }?> name="topictr" id="topictr<?php echo $row->id;?>" >
      <TD ><input type="checkbox" value="<?php echo $row->id;?>" name="e_id[]"  checked="checked"  class="checkbox" />&nbsp;&nbsp;<?php echo $row->id;?></TD>
      <TD align="left" ><a href="<?php echo $topicLink ?>" target="_blank"><?php echo $row->name;?></a></TD>
  
      <TD><a href="javascript:;" title="点击可以编辑专题视频" onclick="javascript:showv('<?php echo $row->id;?>');"><?php echo $tcount-1;?>个视频&nbsp;&nbsp;<i class="iconfont">&#xe6ae;</i></a>
      </TD>
      
     <?php if($cfg_runmode=='0'){?>
            <td><?php isztMake($row->enname,$row->id);?></td>
     <?php }?>
      
      
      <TD ><input name="sort<?php echo $row->id;?>" type="text" value="<?php echo $row->sort;?>" size="5" /></TD>
      <TD ><a  href="?action=ztedit&id=<?php echo $row->id;?>">编辑</a>&nbsp;&nbsp;&nbsp;<a  href="?action=last&id=<?php echo $row->id;?>">上移</a>&nbsp;&nbsp;&nbsp;<a  href="?action=next&id=<?php echo $row->id;?>">下移</a>&nbsp;&nbsp;&nbsp;<a  onclick="if(confirm('确定要删除吗')){return true;}else{return false;}" href="?action=del&id=<?php echo $row->id;?>">删除</a></TD>
    </TR>
<?php }?>
							
                  
    <tr><td colspan="8" ><label>全选&nbsp;&nbsp;<input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="checkAll(this.checked,'input','e_id[]')" /></label>
    &nbsp;&nbsp;<label>反选&nbsp;&nbsp;<input type="checkbox" name="chkothers" id="chkothers" class="checkbox" onclick="checkOthers('input','e_id[]')" /></label>
    &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="批量删除" onclick="if(confirm('确定要删除吗')){topicform.action='?action=delall';}else{return false}" class="rb1"  />&nbsp;&nbsp;<input type="submit" value="批量修改排序" name="Submit" class="rb1" onclick="topicform.action='?action=edit';" /></td></tr>
    
    </table>                
    </form>

    <div id="new_pages" class="layui-fluid"></div>
		</div>
	</div>
</div>

</body>
<script type="text/JavaScript">
	<?php if($idgroup!=""): ?>
    setInterval(getLiveStat,1000,'id_group','stat_group');
	<?php endif; ?>	
	
	layui.use(['laypage', 'layer'], function(){
	  var laypage = layui.laypage
	  ,layer = layui.layer;
	  laypage.render({
	      elem: 'new_pages'
	      ,count: <?php echo $TotalResult;?>
		  ,limit: <?php echo $numPerPage;?>
		  ,curr:<?php echo $page;?>
	      ,layout: ['count', 'prev', 'page', 'next', 'skip']
	      ,jump: function(obj,first){
			  if(!first){
				location.href = '?page='+ obj.curr ;
			}
	      }
	    });
	  });
</script>
</html>